﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/masAdmin.master" AutoEventWireup="true"
    CodeFile="UserDetail.aspx.cs" Inherits="admin_UserDetail" %>

<%@ Register Assembly="CommonTagTime" Namespace="CommonTagTime.RequirementCheckBoxList"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <script src="../scripts/common.js" type="text/javascript"></script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="up">
                <ProgressTemplate>
                    <div class="popWait">
                        <center>
                            Please wait...<br />
                            <img src="/App_Themes/Admin/images/loader.gif" alt="" />
                        </center>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <div class="content-box-header">
                <h3>
                    User Detail
                </h3>
            </div>
            <!-- End .content-box-header -->
            <div class="content-box-content">
                <div class="tab-content default-tab" id="tab1">
                    <table border="0" cellpadding="0" cellspacing="0" class="table100">
                        <tr>
                            <td colspan="2">
                                <span class="commentRequireInputText">
                                    <%=Resources.Resource.LBL_REQUIREMENT%>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td align="left">
                                <asp:ValidationSummary ID="vsumUser" runat="server" ShowMessageBox="true" ShowSummary="false"
                                    CssClass="errorMessage" />
                                <asp:Label ID="lblErrorMessage" runat="server" CssClass="errorMessage"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td width="150px" align="right">
                                Allow Login?:
                            </td>
                            <td>
                                <asp:CheckBox ID="chkIsAllowLogin" Checked="true" runat="server" AutoPostBack="True" OnCheckedChanged="chkIsAllowLogin_CheckedChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td width="150px" align="right">
                                First name(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtFirstName" MaxLength="128" Width="250px" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFirstName" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="First name is require" Display="Dynamic"
                                    ControlToValidate="txtFirstName">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td width="150px" align="right">
                                Last name(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtLastname" MaxLength="128" Width="250px" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqLastName" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="First name is require" Display="Dynamic"
                                    ControlToValidate="txtLastname">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td width="150px" align="right">
                                Email(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmail" MaxLength="256" Width="250px" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqEmail" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="First name is require" Display="Dynamic"
                                    ControlToValidate="txtEmail">*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="regvEmail" runat="server" ControlToValidate="txtEmail"
                                    ErrorMessage="RegularExpressionValidator" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td width="150px" align="right">
                                User Code(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtUserCode" MaxLength="256" Width="250px" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqUserCode" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="User Code is require" Display="Dynamic"
                                    ControlToValidate="txtEmail">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr id="trUserName" runat="server">
                            <td align="right">
                                User name(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtUserName" MaxLength="256" Width="250px" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqUsername" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="Title is require" Display="Dynamic" ControlToValidate="txtUserName">*</asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="cusUserName" runat="server" SetFocusOnError="true" EnableClientScript="true"
                                    Display="Dynamic" ErrorMessage="RequiredFieldValidator" OnServerValidate="CheckSUserNameValid"
                                    ClientValidationFunction="CheckCUserNameValid" ControlToValidate="txtUserName">*</asp:CustomValidator>
                                <span class="commentRequireInputText">Username must be alphabets, numbers, underscore
                                    or dot, length from 4 to 12 character</span>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" valign="middle">
                                Role(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td valign="middle">
                                <asp:CheckBoxList ID="cblRole" runat="server" RepeatLayout="Flow">
                                </asp:CheckBoxList>
                                <cc1:RequiredFieldValidatorForCheckBoxLists ID="reqRole" ControlToValidate="cblRole"
                                    runat="server">*
                                </cc1:RequiredFieldValidatorForCheckBoxLists>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Is Active:
                            </td>
                            <td>
                                <asp:CheckBox ID="chkIsActive" Checked="true" runat="server" />
                            </td>
                        </tr>
                        <tr id="trPass" runat="server">
                            <td align="right">
                                Password(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtPass" MaxLength="128" Width="250px" TextMode="Password" runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqPass" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="Title is require" Display="Dynamic" ControlToValidate="txtPass">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr id="trConfirmPass" runat="server">
                            <td width="150px" align="right">
                                Confirm password(<span class="commentRequireInputText">*</span>):
                            </td>
                            <td>
                                <asp:TextBox ID="txtConfirmPass" MaxLength="128" Width="250px" TextMode="Password"
                                    runat="server">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqConfirmPass" runat="server" EnableClientScript="true"
                                    CssClass="errorMessage" ErrorMessage="Title is require" Display="Dynamic" ControlToValidate="txtConfirmPass">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="cmpConfirmPass" ControlToValidate="txtConfirmPass" ControlToCompare="txtPass"
                                    runat="server" ErrorMessage="CompareValidator">*</asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td style="height: 40px;" valign="bottom">
                                <asp:Button ID="btnSave" runat="server" CssClass="button" Text="Save" OnClick="btnSave_Click"
                                    CausesValidation="true" />
                                <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="Cancel" OnClick="btnCancel_Click"
                                    CausesValidation="false" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        function CheckCUserNameValid(oSrc, args) {
            args.IsValid = CheckUserNameValid(args.Value);
        }
        
    </script>
</asp:Content>
